var str = `
fjskfjsl fjkdsjfkls fjklsfjlsd127.0.0.1fjksldfjafjiojfk192.168.1.101sljfs fsdjfklds
fjsklfsklffjoijfoiafasfjs fed jfjf jf sdjfsi jﬁ jaﬁs function  dd ( ) { }afjsdi
ajf iosa function abc(){} jﬁsjad fjsaiofjaoissf addedfds`;

var re1 = /(127.110.60.1)|(192.168.1.101)/g;
var re2 = /(function\s{1,}\D\w*(\s*(\S||\W)\s*(\S||\W)){2})/g;

var result1;
do{
  result1 = re1.exec(str);
  console.log(result1 && result1[0]);
}while(result1);

var result2;
do{
  result2 = re2.exec(str);
  console.log(result2 && result2[0]);
}while(result2);
